import {actions} from '../base';
import Vue from "vue";

let url = 'admin/api/app-version';

export default {
    namespaced: true,
    state: {
        all: [],
        options: {
            status: [
                {label: '关闭', value: 0},
                {label: '正常', value: 1},
            ]
        },
        request: {
            all: false,
        }
    },
    mutations: {
        SET_ALL (state, data) {
            state.all = data;
        },
        SET_REQUESTING (state, name) {
            state.request[name] = true;
        },
        SET_REQUESTED (state, name) {
            state.request[name] = false;
        }
    },
    actions: Object.assign(actions(url), {
        BatchUpdate({commit}, data) {
            return Vue.axios.put(`${url}/batch`, data);
        },
    }),
};
